<?php /* Smarty version 2.6.26, created on 2013-04-09 01:56:06
         compiled from ../templates/user_form.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'U', '../templates/user_form.html', 19, false),array('function', 'html_options', '../templates/user_form.html', 126, false),)), $this); ?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>コントロールパネル</title>
    <link href="./assets/styles/default.css" rel="stylesheet" />
	<script src="./assets/scripts/libs/jquery-1.7.1.min.js" type="text/javascript"></script>
	<script src="./assets/scripts/import.js" type="text/javascript"></script>
	<script src="./assets/scripts/plugins/zip2address.js" type="text/javascript"></script>
</head>
<body>
<?php echo $this->_tpl_vars['zhead']; ?>

<div id="container">
	<?php echo $this->_tpl_vars['zmenu']; ?>

    <article>
    	<h2><span>&nbsp;</span>会員管理<p><a href="javascript:;">Open Plugins</a></p></h2>
        <nav>
        	<ul>
				<li class="active"><a href="<?php echo ((is_array($_tmp='Home/user/index')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
"><span>会員検索</span></a></li>
				<li><a href="<?php echo ((is_array($_tmp='Home/user/insert')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
"><span>会員登録</span></a></li>
			</ul>
        </nav>
		<section id="content">
			<h3>会員更新</h3>
			<ul class="btns b20" style="position:relative;top:10px;">
			 <li class="btn left c"><a href="<?php echo ((is_array($_tmp='Home/user/refer')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
?id=<?php echo $this->_tpl_vars['forms']['id']; ?>
" >情報参照</a></li>
				<li class="btn center c"><a href="<?php echo ((is_array($_tmp='Home/user/update')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
?id=<?php echo $this->_tpl_vars['forms']['id']; ?>
" class="active">情報更新</a></li>
				<li class="btn center c"><a href="<?php echo ((is_array($_tmp='Home/delivery/refer')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
?id=<?php echo $this->_tpl_vars['forms']['id']; ?>
">配送先情報</a></li>
				<li class="btn center c"><a href="<?php echo ((is_array($_tmp='Home/order/index')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
?id=<?php echo $this->_tpl_vars['forms']['id']; ?>
">注文情報</a></li>
			<li class="btn right c"><a href="<?php echo ((is_array($_tmp='Home/mail/index')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
?id=<?php echo $this->_tpl_vars['forms']['id']; ?>
" >メール履歴</a></li>
			</ul>
			
				<?php if ($this->_tpl_vars['show_massg']): ?>
			
			<p class="message">会員情報を更新します。</p>
			<form name="fm" action="<?php echo ((is_array($_tmp='Home/user/update')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
?id=<?php echo $this->_tpl_vars['forms']['id']; ?>
" method="post" enctype="multipart/form-data">
				<h4><span>&nbsp;</span>基本情報</h4>
				<table class="formTable">
					<tbody>
					
					
						<tr>
							<th>登録日時</th>
							<td> <?php echo $this->_tpl_vars['forms']['c_time']; ?>

								<input type="hidden" name="c_time" value="<?php echo $this->_tpl_vars['forms']['u_time']; ?>
" /></td>
						</tr>
						<tr>
							<th>更新日時</th>
							<td> <?php echo $this->_tpl_vars['forms']['u_time']; ?>

								<input type="hidden" name="u_time" value="<?php echo $this->_tpl_vars['forms']['u_time']; ?>
" /></td>
						</tr>
						<tr>
							<th>システムID</th>
							<td><?php echo $this->_tpl_vars['forms']['id']; ?>
<input type="hidden" name="id" value="<?php echo $this->_tpl_vars['forms']['id']; ?>
" /></td></td>
						</tr>
						
						
						
						<tr>
							<th class="must">状態</th>
							<td>
							<label><input type="radio" name="state" <?php if ($this->_tpl_vars['forms']['state'] == 1): ?>checked=true<?php endif; ?> value="1" />通常</label>
								<label><input type="radio" name="state" <?php if ($this->_tpl_vars['forms']['state'] == 2): ?>checked=true<?php endif; ?> value="2" />仮登録</label>
								<label><input type="radio" name="state" <?php if ($this->_tpl_vars['forms']['state'] == 3): ?>checked=true<?php endif; ?> value="3" />退会</label>
							<?php echo $this->_tpl_vars['err_mes']['state']; ?>

							</td>
						</tr>
						<tr>
							<th class="must">ID</th>
							<td><input type="text" name="login_id" value="<?php echo $this->_tpl_vars['forms']['login_id']; ?>
" /></td>
							<?php echo $this->_tpl_vars['err_mes']['login_id']; ?>

						</tr>
						<tr>
							<th class="must">パスワード</th>
							<td>
								<input type="text" name="login_pwd" id="text_auth_pwd"  value="<?php echo $this->_tpl_vars['forms']['login_pwd']; ?>
" />
								<?php echo $this->_tpl_vars['err_mes']['login_pwd']; ?>

							</td>
						</tr>
						<tr>
							<th class="must">会員氏名</th>
							<td>
								<input type="text" class="short" name="user_name1" value="<?php echo $this->_tpl_vars['forms']['user_name1']; ?>
" id="url" />
								<input type="text" class="short" name="user_name2" value="<?php echo $this->_tpl_vars['forms']['user_name2']; ?>
" />
								<?php echo $this->_tpl_vars['err_mes']['user_name1']; ?>
<?php echo $this->_tpl_vars['err_mes']['user_name2']; ?>
<?php echo $this->_tpl_vars['err_mes']['user_name']; ?>

							</td>
						</tr>
						<tr>
							<th class="must">フリガナ</th>
							<td>
								<input type="text" class="short" name="user_name_furikana1" value="<?php echo $this->_tpl_vars['forms']['user_name_furikana1']; ?>
" />
								<input type="text" class="short" name="user_name_furikana2" value="<?php echo $this->_tpl_vars['forms']['user_name_furikana2']; ?>
" />
								<?php echo $this->_tpl_vars['err_mes']['user_name_furikana1']; ?>
<?php echo $this->_tpl_vars['err_mes']['user_name_furikana2']; ?>

							</td>
						</tr>
						<tr>
							<th>貴医院名・貴技工所名</th>
							<td>
								<input type="text" class="text" name="workshop_name" value="<?php echo $this->_tpl_vars['forms']['workshop_name']; ?>
" />
								<?php echo $this->_tpl_vars['err_mes']['workshop_name']; ?>

							</td>
						</tr>
						<tr>
							<th>フリガナ</th>
							<td>
								<input type="text" class="text" name="workshop_name_furikana" value="<?php echo $this->_tpl_vars['forms']['workshop_name_furikana']; ?>
" />
								<?php echo $this->_tpl_vars['err_mes']['workshop_name_furikana']; ?>

							</td>
						</tr>
						<tr>
							<th class="must">郵便番号</th>
							<td class="floats">
								<input type="text" name="zipcode1" class="short" value="<?php echo $this->_tpl_vars['forms']['zipcode1']; ?>
" />
								<span> - </span>
								<input type="text" name="zipcode2" class="short" value="<?php echo $this->_tpl_vars['forms']['zipcode2']; ?>
" />
								<span class="btn_blank">
									<a href="javascript:;" style="position:relative;top:-2px;" class="searchAddress">住所検索</a>
								</span>
								<?php echo $this->_tpl_vars['err_mes']['zipcode']; ?>
<?php echo $this->_tpl_vars['err_mes']['zipcode1']; ?>
<?php echo $this->_tpl_vars['err_mes']['zipcode2']; ?>

							</td>
						</tr>
						<tr>
							<th class="must">都道府県</th>
							<td>
								<select name="local_cd" id='select_id'>
									  <?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['dao_local'],'selected' => $this->_tpl_vars['forms']['local_cd']), $this);?>

								</select>
								<?php echo $this->_tpl_vars['err_mes']['local_cd']; ?>

							</td>
						</tr>
						<tr>
							<th class="must">市区町村</th>
							<td><input type="text" name="treet_name" id="treet_name" class="text" value="<?php echo $this->_tpl_vars['forms']['treet_name']; ?>
" />
							<?php echo $this->_tpl_vars['err_mes']['treet_name']; ?>
</td>
							
						</tr>
						<tr>
							<th class="must">以降の住所</th>
							<td><input type="text" name="address" class="text" value="<?php echo $this->_tpl_vars['forms']['address']; ?>
" /> <?php echo $this->_tpl_vars['err_mes']['address']; ?>
</td>
						</tr>
						<tr>
							<th class="must">電話番号</th>
							<td>
								<input type="text" class="short" name="tel_number1" value="<?php echo $this->_tpl_vars['forms']['tel_number1']; ?>
" /> -
								<input type="text" class="short" name="tel_number2" value="<?php echo $this->_tpl_vars['forms']['tel_number2']; ?>
" /> -
								<input type="text" class="short" name="tel_number3" value="<?php echo $this->_tpl_vars['forms']['tel_number3']; ?>
" />
								<?php echo $this->_tpl_vars['err_mes']['tel_number']; ?>
<?php echo $this->_tpl_vars['err_mes']['tel_number1']; ?>
<?php echo $this->_tpl_vars['err_mes']['tel_number2']; ?>
<?php echo $this->_tpl_vars['err_mes']['tel_number3']; ?>

							</td>
						</tr>
						<tr>
							<th>携帯電話番号</th>
							<td>
								<input type="text" class="short" name="mobile_number1" value="<?php echo $this->_tpl_vars['forms']['mobile_number1']; ?>
" /> -
								<input type="text" class="short" name="mobile_number2" value="<?php echo $this->_tpl_vars['forms']['mobile_number2']; ?>
" /> -
								<input type="text" class="short" name="mobile_number3" value="<?php echo $this->_tpl_vars['forms']['mobile_number3']; ?>
" />
								<?php echo $this->_tpl_vars['err_mes']['mobile_number']; ?>
<?php echo $this->_tpl_vars['err_mes']['mobile_number1']; ?>
<?php echo $this->_tpl_vars['err_mes']['mobile_number2']; ?>
<?php echo $this->_tpl_vars['err_mes']['mobile_number3']; ?>

							</td>
						</tr>
						<tr>
							<th class="must">E-Mail</th>
							<td><input type="text" name="email" class="text" value="<?php echo $this->_tpl_vars['forms']['email']; ?>
" />
							<?php echo $this->_tpl_vars['err_mes']['email']; ?>
</td>
						</tr>
						<tr>
							<th>メルマガ購読（PC）</th>
							<td><label><input type="checkbox" name="send"  <?php if ($this->_tpl_vars['forms']['send'] == '1'): ?> checked="true"<?php endif; ?> value="1" />購読する</label></td>
						</tr>
						<tr>
							<th>退会理由</th>
							<td>
								退会日時：<?php echo $this->_tpl_vars['forms']['r_time']; ?>
<br />
								
								<textarea name="retreat"><?php echo $this->_tpl_vars['forms']['retreat']; ?>
</textarea>
								<?php echo $this->_tpl_vars['err_mes']['retreat']; ?>

							</td>
						</tr>
			      <tr>
							<th>生年月</th>
							<td class="floats">
						<?php echo smarty_function_html_options(array('id' => 'year4','name' => 'year4','options' => $this->_tpl_vars['year4'],'selected' => $this->_tpl_vars['forms']['birthday_year']), $this);?>

						<?php echo smarty_function_html_options(array('id' => 'moon4','name' => 'moon4','options' => $this->_tpl_vars['moon4'],'selected' => $this->_tpl_vars['forms']['birthday_m']), $this);?>

						<?php echo $this->_tpl_vars['err_mes']['birthday']; ?>
		
							</td>
							
						</tr>
						<tr>
							<th>性別</th>
							<td>
								<label><input type="radio" name="sex" <?php if ($this->_tpl_vars['forms']['sex'] == 1): ?>checked=true<?php endif; ?> value="1" />女性</label>
								<label><input type="radio" name="sex" <?php if ($this->_tpl_vars['forms']['sex'] == 2): ?>checked=true<?php endif; ?> value="2" />男性</label>
								<label><input type="radio" name="sex" <?php if ($this->_tpl_vars['forms']['sex'] == 3): ?>checked=true<?php endif; ?> value="3" />指定なし</label>
							
							</td>
						</tr>
					</tbody>
				</table>

				<p class="button">
					<button type="button" id="btn_update" class="submit"><span>更新</span></button>
				</p>
			</form>
		
		<?php else: ?>
			<p class="message"><?php echo $this->_tpl_vars['message']; ?>
</p>
			
			
			<ul class="result_btn clear" style="margin-top:20px;">
                <li><a href="<?php echo ((is_array($_tmp='Home/User/index')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
">一覧に戻る</a></li>
                <li><a href="<?php echo ((is_array($_tmp='Home/User/insert')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
">続けて新規登録する</a></li>
            <?php if (isset ( $this->_tpl_vars['forms']['id'] )): ?>
                <li><a href="<?php echo ((is_array($_tmp='Home/User/update')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
?id=<?php echo $this->_tpl_vars['forms']['id']; ?>
">登録した内容を更新する</a></li>
            <?php endif; ?>
        	</ul>
			
		<?php endif; ?>
		
		</section>
	</article>
</div>
<script type="text/javascript">
		$(function(){
	//search address
		$('.searchAddress').live('click',function(){
			var p = $(this).closest("td");
			var table = $(this).closest("table");
			var post1 = $('input[name=zipcode1]').val();
			var post2 = $('input[name=zipcode2]').val();
			if(post1 == "" || post2 == ""){return;}
			var post = post1 +""+ post2;
			zip2address(post, function(address) {
			if (address) {
				$("#treet_name").val(address.city);
				$("#uniform-select_id>span").text(address.pref);
				//$("#select_id").val(address.index)
				$("#select_id").children().attr("selected",false);
				$("#select_id").find("option[value='"+(address.index+1)+"']").attr("selected",true);
		
			
			}
			else {
				alert("見つかりませんでした。。\n入力した郵便番号に誤りがないか、お確かめ下さい。");
			}
		});
			
		});
		});
</script>
<?php echo $this->_tpl_vars['zfooter']; ?>

</body>
</html>